<?php
if(!defined('CMS'))die;
$GLOBALS['jscripts'][]='js/multilang.js';
$one=isset($v_0) ? $v_0 : false;
$langs=isset($v_1) ? $v_1 : array();
$name=isset($v_2) ? $v_2 : false;
$ti=isset($v_3) ? array('tabindex'=>$v_3) : array();#tabindex

$mchecks=array();
foreach(Eleanor::$langs as $k=>&$v)
	$mchecks[]='<label>'.Eleanor::Check('lang[]',isset($langs[$k]) ? $langs[$k] : true,$ti+array('value'=>$k)).' '.$v['name'].'</label>';
echo '<label>'.Eleanor::Check('one_lang',$one,$ti).' <b>'.Eleanor::$Language['main']['for_all_langs']
	.'</b></label><div style="display:'.($one ? 'none' : 'block').'">'
	.join('<br />',$mchecks).'</div><script type="text/javascript">/*<![CDATA[*/'.($name ? 'var '.$name.';' : '').'$(function(){'.($name ? $name.'=' : '').'new MultilangChecks({mainlang:"'.Language::$main.'"});});//]]></script>';